package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.PostfixExpression;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologPostfixExpressionConverter extends PrologConverter implements
		IConverter<PostfixExpression> {

	public PrologPostfixExpressionConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(PostfixExpression node) {
		String args[] = {
				(new StringBuilder("[")).append(
						idResolver.getID(node.getOperand())).append("]")
						.toString(),
				(new StringBuilder("'")).append(node.getOperator().toString())
						.append("'").toString(), "1" };
		createBodyFact(node, "operationT", args);
		return true;
	}

}
